﻿using System;
using System.Collections.Generic;
using System.Text;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;

namespace RDJTProtocolServer
{
    public class RdjtpResponse
    {
        public string Status { get; set; }
        public string Body { get; set; }
        public RdjtpResponse() { }

        public RdjtpResponse(int status)
        {
            Status = RdjtpStatus.GetText(status);
        }

        public string ToJson()
        {
            var jsonSerializerSettings = new JsonSerializerSettings();
            jsonSerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver();
            return JsonConvert.SerializeObject(this, jsonSerializerSettings);
        }
    }
}
